<style type="text/css">
    .timer {
        visibility: hidden;
        text-align: center;
        font-family: Arial;
    }

    .timer_pad {
        padding: 0px;
    }

    .digits {
        margin-top: 0px;
        color: black;
        font-size: 10pt;
        font-family: Verdana;
    }

    .title {
        color: white;
    }

    .hours, .minutes, .seconds {
        margin-left: 3px;
    }

    .hours, .minutes {
        margin-right: 5px;
    }

    .field_cont {
        margin-top: 105px;
    }

    .field {
        color: black;
    }

    .btn_cont {
        margin-top: 0px;
    }

    .start, .pause, .resume {
        margin-right: 5px;
    }
</style>

<div id ="header">
    <!-- show announcements -->
    <c:if test="${announcement!=null}">
        <div id="announcement">
            <p><c:out value="${announcement}"/></p>
        </div>
    </c:if>
    <div id="headerPlayer">
        <b>Player's Info</b> <br/>
        #${player.player_id}<br/>
        ${player.player_name}<br/>
        ${player.company_name}<br/>
    </div>

    <div id="turnInfo">
        <input type="hidden" id="count_down" value="${turn.countdown_second}" />
        <div id="time-left"></div>
        <div id="current-turn">
            <c:if test="${turn.current_turn >= 0}">
                Turn ${turn.current_turn}
            </c:if>
        </div>
    </div>
    <div id="budget-left">${player.balance_string}</div>

    <script type="text/javascript">

        function display(){
            var abc = document.getElementById("count_down").value;
            if (abc >= 0 && abc != "") {
                if (abc == 0){
                    document.getElementById("time-left").innerHTML = "time's up!"
                } else {
                    var min = Math.floor(abc/60);
                    var seconds = Math.floor(abc%60);
                    if (seconds<=0){
                        seconds=59
                        min-=1
                    } else {
                        seconds-=1
                    }
                    abc -= 1
                    document.getElementById("count_down").value = abc
                    document.getElementById("time-left").innerHTML = min + " min " + seconds + " sec"
                }
            } else {
                document.getElementById("time-left").innerHTML = "game paused"
            }
            setTimeout("display()",1000)
        }

        display()
    </script>


</div>